package edu.biwu;

import javax.servlet.*;
import java.io.IOException;

/**
 * @author 王俊彪
 * @version 1.0
 */
public class FilterDemo01 implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        System.out.println("FilterDemo01开始执行 "+request+" …… "+response);
        chain.doFilter(request,response);
        response.setContentType("text/html;charset=utf-8");
        response.getWriter().write("FilterDemo01 被响应");
    }

    @Override
    public void destroy() {

    }
}
